package com.lifeng.controller;

import com.lifeng.service.api.UserServiceFeign;
import com.lifeng.service.dto.UserDTO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.UUID;

/**
 * @author:lifeng
 * @date:2020/7/26 10:03
 */
@RestController
public class DemoController {
    @Resource
    private UserServiceFeign userServiceFeign;

    @RequestMapping("/user")
    public Object user(){
        UserDTO dto = new UserDTO();
        dto.setUserId(UUID.randomUUID().toString());
        dto.setUserName("张三");
        dto.setAge(23);
        dto.setBirthday(new Date());
        try {
            return userServiceFeign.saveUserMap(dto);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
